Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

339
Views
ActionController:UnknownFormat respond_to do |format|

I'm trying to sign up Users using Devise, and render a JS file if a certain parameter is included in the sign-up. I'm getting the following error:

ActionController::UnknownFormat in RegistrationsController#create
ActionController::UnknownFormat

This is my "create" action (I marked the line the error pointed to):

if resource.persisted?
  if resource.active_for_authentication?
    set_flash_message :notice, :signed_up if is_flashing_format?
    sign_up(resource_name, resource)
    if !params[:name].nil?
      View.create(name: params[:name])
      respond_to do |format| #THIS IS THE LINE WITH THE ERROR
        format.js
      end
    else
      respond_with resource, location: after_sign_up_path_for(resource)
    end
  else
    respond_with resource, location: inactive_path_for(resource)
  end
else
  respond_with resource
end

The action is "create", in app/controllers/registrations_controller.rb. The JS file I'm trying to render is app/views/devise/registrations/create.js.erb.

My suspicion is that there's a problem with finding the file, but I can't figure out how to point it to the right route, or if that's even the right problem. Anyone have any thoughts?

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!